package com.sunkey.service.impl;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;

import com.sunkey.dao.UserDao;
import com.sunkey.domain.User;
import com.sunkey.service.UserService;

@Service
public class UserServiceImpl implements UserService ,InitializingBean, ApplicationContextAware{

    private UserDao userDao;

    @Override
    public User getUser() {

        return userDao.findUser("sunkey");
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
       System.out.println("=========================================");
        
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        System.out.println("===================aware======================");
        
    }

}
